package nimingneibulei;

public class Test {
    public static void main(String[] args) {
        go(new Swimming(){
            @Override
            public void swim(){
                System.out.println("狗狗游得飞快");
            }
        });
    }

    // 设计一个方法，接受Swimming接口的一切实现类来参加游泳比赛
    public static void go(Swimming s){
        System.out.println("-----------开始-----------");
        s.swim();
    }
}

// Swimming接口
interface Swimming{
    void swim();
}